package week05;
import java.util.*;

public class Alphabetize1 {

public static void main(String[] args) {

//... Declare variables.

Scanner      in  = new Scanner(System.in);

ArrayList<String> words = new ArrayList<String>();

//... Read input one word at a time.

System.out.println("Enter words. End with EOF (.)");

//... Read input one word at a time, adding it to an array list.

{

    words.add(in.next());
}

//... Sort the words.

Collections.sort(words);

//... Print the sorted list.

System.out.println("\n\nSorted words.\n");

for (String word : words) {

System.out.println(word);


}

}

}
